using System;

namespace Sedna.Core.Persistence
{
	/// <summary>
	/// this is an abstract interface that represents a filter state for a Grid
	/// and provides the common ability to set up the start record, total amount or records per page,
	/// set the sorting order and the sorting expression
	/// 
	/// The filter can have several implementations one of which allows to create a NHibernate Criteria 
	/// automatically based upon the properties of a Filter
	/// Those properties reflect the fields (or parameters) or a filter frame on a User UI screen
	/// Another implementation can generate a HQL request string based upon its internal logic.
	/// 
	/// Developers are encouraged to use auto-generated filter states 
	/// so as to minimiza the amount of custom coding
	/// </summary>
	public interface IFilterState : ICloneable, IDataProvider
	{		
		/// <summary>
		/// this method is used by the WebUI framework to 
		/// reset the filter state. (Normally it is mapped to a Reset button on a screen)
		/// </summary>
		/// <returns>
		/// the same filter but in reset state so as to avoid creation of 
		/// a new instance of a filter
		/// and to be able to chain the method calls.
		/// </returns>
		IFilterState Reset();
	}
}
